using UnityEngine.UIElements;

namespace DA.AnimGraph.Editor {

    internal class InspectorField_SyncGroupPerk : InspectorField<AGAPerkModel_SyncGroup> {

        TextField textField;

        protected override void BuildUI() {
            labelText = "Sync Group";

            textField = new TextField("group name");
            textField.value = source.groupName;
            textField.RegisterValueChangedCallback(evt => OnChanged());
        }

        protected override void DrawUI() {
            Add(textField);
        }

        protected override void ClearUI() {
            base.ClearUI();
        }

        private void OnChanged() {
            source.groupName = textField.value;

            inspectorChangeCallback?.Invoke();
        }
    }

}
